<?php

namespace app\api\command;

use think\console\Command;
use think\console\Input;
use think\console\Output;
use think\Log;

class OrderOk extends Command
{

    protected function configure()
    {
        $this->setName('order_ok')->setDescription('订单支付成功,废弃的Cli');
    }

    protected function execute(Input $input, Output $output)
    {
        ini_set('default_socket_timeout', -1);  //不超时
        $redis = new \Redis();
        $redis->pconnect('127.0.0.1', 6379);

        // 支付成功订阅 【废弃的】
        $redis->subscribe(['ORDER_SUCCESS'], function ($instance, $channel, $message) {
            Log::info('ORDER_SUCCESS 订单号：' . $message);
        });
    }
}